<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>CodeLog-欢迎页面</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="referrer" content="always">
    <link rel="stylesheet" href="/static/css/admin-index.css">
    <link rel="stylesheet" href="/static/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/x-admin/font.css">
    <link rel="stylesheet" href="/static/css/x-admin/xadmin.css">
</head>
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a>首页</a>
        <a>我的桌面</a>
        <a>
          <cite>WelCome</cite></a>
      </span>
    <a class="layui-btn layui-btn-sm layui-btn-radius" style="line-height:1.6em;margin-top:4px;float:right"
       href="javascript:location.reload();" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-anim layui-anim-scale x-body">
    <blockquote class="layui-elem-quote">欢迎管理员：<span
            class="x-red">${user.userName}</span>！<span>当前时间:${currentDateTime}</span>
    </blockquote>
    <fieldset class="layui-elem-field">
        <legend>数据统计</legend>
        <div class="layui-field-box">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div class="x-admin-carousel x-admin-backlog codelog-panel " lay-anim="" lay-indicator="inside"
                             lay-arrow="none">
                            <div carousel-item="">
                                <ul class="layui-row layui-col-space10 layui-this">
                                    <li class="layui-col-md3 layui-col-xs12">
                                        <a class="x-admin-backlog-body">
                                            <h3>文章数</h3>
                                            <p>
                                                <cite><#if allArticleQuantity??>${allArticleQuantity}<#else>
                                                    0</#if></cite>
                                            </p>
                                        </a>
                                    </li>
                                    <li class="layui-col-md3 layui-col-xs12">
                                        <a href="#" class="x-admin-backlog-body">
                                            <h3>评论数</h3>
                                            <p>
                                                <cite><#if allCommentQuantity??>${allCommentQuantity}<#else>
                                                    0</#if></cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-md3 layui-col-xs12">
                                        <a href="#" class="x-admin-backlog-body">
                                            <h3>附件数</h3>
                                            <p>
                                                <cite>12312367</cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-md3 layui-col-xs12">
                                        <a href="#" class="x-admin-backlog-body">
                                            <h3>成立天数</h3>
                                            <p>
                                                <cite>1280</cite></p>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </fieldset>
    <fieldset class="layui-elem-field">
        <legend>最新文章</legend>
        <div class="layui-field-box">
            <table class="layui-table">
                <tbody>
                <tr>
                    <th>标题</th>
                    <th>状态</th>
                    <th>日期</th>
                    <th>浏览量</th>
                    <th>评论</th>
                </tr>
                <#list fiveArticle as article>
                    <tr>
                        <td><span>${article.getArticleTitle()}</span></td>
                        <td>
                            <#if article.getArticleStatus()==0>
                                <span class="layui-btn layui-btn-danger layui-btn-xs">审核</span>
                            <#elseIf article.getArticleStatus()==1>
                        <span class="layui-btn layui-btn-xs">公开</span>
                            <#elseIf article.getArticleStatus()==2>
                        <span class="layui-btn layui-btn-warm layui-btn-xs">草稿</span>
                            </#if>
                        </td>
                        <td><span>${article.getCreateTime()?string('yyyy-MM-dd HH:mm:ss')}</span></td>
                        <td><span>${article.getArticleViews()}</span></td>
                        <td><span>${article.getComments()?size}</span></td>
                    </tr>
                </#list>
                </tbody>
            </table>
        </div>
    </fieldset>
    <fieldset class="layui-elem-field">
        <legend>最新评论</legend>
        <div class="layui-field-box">
            <table class="layui-table">
                <tbody>
                <tr>
                    <th>评论者</th>
                    <th>状态</th>
                    <th>评论文章</th>
                    <th>内容</th>
                    <th>时间</th>
                </tr>
                <#list fiveComment as comment>
                    <tr>
                        <td><span>${comment.getCommAuthorName()}</span></td>
                        <td>
                            <#if comment.getCommStatus()?? && comment.getCommStatus() == 0>
                                <span class="layui-btn layui-btn-xs">正常</span>
                            <#elseIf comment.getCommStatus()?? && comment.getCommStatus() == 1>
                                <span class="layui-btn layui-btn-danger layui-btn-xs">审核</span>
                            </#if>
                        </td>
                        <td><span>${comment.getArticleTitle()}</span></td>
                        <td><span>${comment.getCommContent()}</span></td>
                        <td><span>${comment.getCommDate()?string('yyyy-MM-dd HH:mm:ss')}</span></td>
                    </tr>
                </#list>
                </tbody>
            </table>
        </div>
    </fieldset>
    <fieldset class="layui-elem-field">
        <legend>最新日志</legend>
        <div class="layui-field-box">
            <table class="layui-table" lay-size="lg">
                <tbody>
                <tr>
                    <th>事件</th>
                    <th>结果</th>
                    <th>IP</th>
                    <th>时间</th>
                </tr>
                <#list logs as log>
                    <tr>
                        <th>${log.getLogTitle()}</th>
                        <th>${log.getLogContent()}</th>
                        <th>${log.getLogIp()}</th>
                        <th>${log.getCreateTime()?string('yyyy-MM-dd HH:mm:ss')}</th>
                    </tr>
                </#list>
                </tbody>
            </table>
            <button class="layui-btn layui-btn-normal" onclick="x_admin_show('查看所有日志','/admin/logs/showLogs')">查看所有
            </button>
        </div>
    </fieldset>
</div>
<script type="text/javascript" src="/static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/lib/layui/layui.js"></script>
<script type="text/javascript" src="/static/js/x-admin/xadmin.js"></script>
</body>
</html>